
        <section class="content-header">
          <h1>场馆预约</h1>
          <ol class="breadcrumb">
            <li><a href="../"><i class="fa fa-home"></i> 首页</a></li>
            <li class="active">场馆预约</li>
          </ol>
        </section>

        <section class="content">

          <div class="row">
            <div class="col-xs-12">
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">
                      <a href="/admin/venreserve/info"><span class="label label-success"><i class="fa fa-plus"></i> 新增</span></a>
                  </h3>
				  <div class="box-tools">
                   <form class="form-inline" name="form1" method="get" id="form1">
                    <div class="input-group" style="width: 150px;">
                      <div class="input-group-btn">
						<input style="width:125px;" type="text" name="keyword" value="" class="form-control input-sm" placeholder="场馆名称...">
                        <button type="submit" class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                      </div>
                    </div>
                      </form>
                  </div>
                </div>
                <div class="box-body table-responsive no-padding">
					<table class="table table-hover" cellspacing="0" border="0" id="ctl00_cphMain_GridView1" style="border-width:0px;border-collapse:collapse;">
					<tr>
						<th scope="col">序号</th>
						<th scope="col">场馆名称</th>
						<th scope="col">场馆管理员</th>
						<th scope="col">场馆联系电话</th>
						<th scope="col">场馆地址</th>
						<th scope="col">状态</th>
						<th scope="col">操作</th>
					</tr>
					{volist name="list" id="vo"}
					<tr id="tr_{$vo.id}">
						<td class="id">{$i}</span></td>
						<td>{$vo.title}</td>
						<td>{$vo.manager}</td>
						<td>{$vo.telephone}</td>
						<td>{$vo.address}</td>
						<td>{if $vo.status ==1}正常{else/}禁用{/if}</td>
						<td>
							<a href="/admin/venreserve/orderlist?pid={$vo.id}"><span class="label label-primary"><i class="fa fa-edit"></i> 预约列表</span></a>
							<a href="javascript:ewm({$vo.id},'{$vo.title}');"><span data-toggle="modal" data-target="#myModal" class="label label-warning"><i class="fa fa-edit"></i> 场馆二维码</span></a>
							<a href="/admin/venreserve/opentimes?pid={$vo.id}"><span class="label label-success"><i class="fa fa-edit"></i>开放时间表</span></a>
							<a href="/admin/venreserve/info?id={$vo.id}"><span class="label label-primary"><i class="fa fa-edit"></i> 修改</span></a>
							<a onclick="confirmDel({$vo.id});" href="javascript:;" ><span class="label label-danger"><i class="fa fa-remove"></i> 删除</span></a>
						</td>
					</tr>
					{/volist}
					</table>
                </div>
				<div id="pager">
                <!--分页-->
                    {$list -> render()}
				</div>
              </div>
            </div>
          </div>
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog" style="width: 300px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;
                            </button>
                            <h4 class="modal-title">
                                【<span id="shoptitle"></span>】场馆二维码
                            </h4>
                        </div>
                        <div class="modal-body">
                            <img id="shopcode" src="/images/adefault.png" height="250" width="250" style="margin: 0 auto;display: block;"/>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                            </button>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal -->
        </section>

<script type="text/javascript">
function ewm(id,title) {
	$('#shopcode').attr('src','/admin/venreserve/shop_qrcode?id='+id);
	$("#shoptitle").html(title);
}
function confirmDel(id){
  layer.confirm('确认要删除吗', {icon: 3}, function(){
    $.ajax({
		type: "GET",
		dataType: "json",
		url: '/admin/venreserve/del',
		data: {"delid":id},
		async: false,
		success: function(data) {
		  if(data == 1){
			layer.msg('删除成功');
			$('#tr_'+id).remove();
		  }else if(data == 2){
			layer.msg('没有权限删除');
		  }else{
			layer.msg('操作失败'+data);
		  }
		},
		error: function(){
		  layer.msg('系统错误！请稍后访问');
		}
	  }); 
  });
}
</script>
